package com.hqyj.controller;

import com.hqyj.pojo.User;
import com.hqyj.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;


@RestController
@RequestMapping("/userReful")
public class UserRefulController {
    @Autowired
    UserService userService;
    //登录
    @RequestMapping("/login")
    public HashMap<String, String> login(User user){
        return  userService.login(user);
    }
    //加载表格数据
    @RequestMapping("/userList")
    public HashMap<String,Object> listPage(User user){
        return userService.select(user);
    }
    @RequestMapping("/add")
    public HashMap<String,Object> addPage(User user){
        return userService.add(user);
    }
    @RequestMapping("/update")
    public HashMap<String,Object> update(User user){return userService.update(user);}
    @RequestMapping("/del")
    public HashMap<String,Object> del(Integer id){return userService.del(id);}


}
